Path: blob/master/Part 9 - Dimension Reduction/Linear Discriminant Analysis/[R] Linear Discriminant Analysis.ipynb
1341 views
Kernel: R
Linear Discriminant Analysis
Data preprocessing
In [1]:
In [2]:
Out[2]:
In [3]:
In [4]:
Out[4]:
In [5]:
Out[5]:
In [6]:
In [7]:
Out[7]:
In [8]:
Out[8]:
Applying Linear Discriminant Analysis
In [9]:
In [10]:
In [11]:
Out[11]:
In [12]:
In [13]:
Out[13]:
In [14]:
In [15]:
Out[15]:
Fitting classifier to the Training set
In [16]:
Predicting the Test set results
In [17]:
In [18]:
Out[18]:
In [19]:
Out[19]:
Making the Confusion Matrix
In [20]:
In [21]:
Out[21]:
y_pred
1 2 3
1 12 0 0
2 0 14 0
3 0 1 9
classifier made 12 + 14 + 9 = 35 correct prediction and 1 incoreect prediction.
Visualizing the Training set results
In [22]:
In [23]:
In [24]:
Out[24]:
Visualizing the Test set results
In [25]:
In [26]:
Out[26]: